package com.thx.user.view;

import java.io.Serializable;
import java.util.Date;

import com.thx.log.model.Log;
import com.thx.user.model.User;

public class OnLineUser implements Serializable{
	private static final long serialVersionUID = -4327412489137015888L;
	
	
	private String userId;
	
	private String userName;
	
	private String realName;
	
	private Date loginTime;
	
	private String realityIp;
	
	private String proxyIp;
	
	private String device;

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public Date getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}

	public String getRealityIp() {
		return realityIp;
	}

	public void setRealityIp(String realityIp) {
		this.realityIp = realityIp;
	}

	public String getProxyIp() {
		return proxyIp;
	}

	public void setProxyIp(String proxyIp) {
		this.proxyIp = proxyIp;
	}

	public String getDevice() {
		return device;
	}

	public void setDevice(String device) {
		this.device = device;
	}

	public OnLineUser() {
		super();
	}

	public OnLineUser(User user, Log log) {
		
		if(user!=null){
			
			userId = user.getUserId();
			
			userName = user.getUserName();
			
			realName = user.getRealName();
		}
		if(log!=null){
			
			loginTime = log.getCreateDate();
			
			realityIp = log.getRealityIp();
			
			proxyIp = log.getProxyIp();
			
			device  = log.getDevice();
			
		}
		
		
	}
	
	
	
}
